package polymorphic2;

import java.util.Objects;

/**
 * @classname:Salary
 * @description:
 * @author: Mr.Z
 * @date: 2020/12/2 17:19
 * @version: 0.1
 * @since:1.8
 */
public class Salary {
    private Salary(){}


    public static double CaleSalary(Employee employee){
        Objects.requireNonNull(employee,"空值");
        if(employee instanceof PM){

            return employee.getSalary()+((PM) employee).getBonus();
        }
        return employee.getSalary();
    }
}
